<div class="row-content am-cf">
	<div class="row">
		<div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
			<div class="widget am-cf">
				<form id="my-form" class="am-form tpl-form-line-form" method="post">
					<div class="widget-body">
						<fieldset>
							<div class="widget-head am-cf">
								<div class="widget-title am-fl">微信支付设置</div>
							</div> <input type="hidden" name="data[app_id]" value="{$user['applet']['app_id']}">
							<div class="am-form-group"> <label
									class="am-u-sm-3 am-u-lg-2 am-form-label form-require">特约商户 </label>
								<div class="am-u-sm-9 am-u-end"> <label class="am-radio-inline"> <input v-model="is_sub"
											type="radio" name="data[is_sub]" value="0" data-am-ucheck
											{$model['is_sub']==0 ? 'checked' : '' }> 否 </label> <label
										class="am-radio-inline"> <input v-model="is_sub" type="radio"
											name="data[is_sub]" value="1" data-am-ucheck {$model['is_sub']==1
											? 'checked' : '' }> 是 </label>
									<div class="help-block"> <small>特约商户：由微信支付服务商辅助开通的微信支付“商户号”</small> </div>
								</div>
							</div>
							<div class="am-form-group"> <label class="am-u-sm-3 am-u-lg-2 am-form-label form-require">
									商户号 <span class="tpl-form-line-small-title">MCH_ID</span> </label>
								<div class="am-u-sm-9 am-u-end"> <input type="text" class="tpl-form-input"
										name="data[mch_id]" value="{$model['mch_id']}"> <small>我还没有，<a
											href="<?= url('wxapp.register/wxpay') ?>">去申请</a>（特约商户号）</small> </div>
							</div>
							<div v-if="is_sub == 0">
								<div class="am-form-group"> <label
										class="am-u-sm-3 am-u-lg-2 am-form-label form-require"> API密钥 <span
											class="tpl-form-line-small-title">APIv2</span> </label>
									<div class="am-u-sm-9 am-u-end"> <input type="text" class="tpl-form-input"
											name="data[api_key]" value="{$model['api_key']}"> </div>
								</div>
								<div class="am-form-group am-padding-top"> <label
										class="am-u-sm-3 am-u-lg-2 am-form-label"> API证书 <span
											class="tpl-form-line-small-title">apiclient_cert.pem</span> </label>
									<div class="am-u-sm-9 am-u-end"> <textarea rows="3"
											name="data[cert_pem]">{$model['cert_pem']}</textarea>
										<small>退款功能必填：使用文本编辑器打开apiclient_cert.pem文件，将文件的全部内容复制进来</small> </div>
								</div>
								<div class="am-form-group"> <label class="am-u-sm-3 am-u-lg-2 am-form-label"> API证书
										<span class="tpl-form-line-small-title">apiclient_key.pem</span> </label>
									<div class="am-u-sm-9 am-u-end"> <textarea rows="3"
											name="data[key_pem]">{$model['key_pem']}</textarea>
										<small>退款功能必填：使用文本编辑器打开apiclient_key.pem文件，将文件的全部内容复制进来</small> </div>
								</div>
							</div>
							<div class="am-form-group">
								<div class="am-u-sm-9 am-u-sm-push-2 am-margin-top-lg"> <button type="submit"
										class="j-submit am-btn am-btn-secondary">提交 </button> </div>
							</div>
						</fieldset>
					</div>
				</form>
			</div>
		</div>
	</div>
</div>
<script src="/assets/plugins/vue/vue.min.js?v={$version}"></script>
<script>
	$(function() {
		new Vue({
			el: '#my-form',
			data: {
				is_sub: "{$model['is_sub']}"
			}
		});
		$('#my-form').formPost();
	});
</script>
